#ifndef PERSPECTIVE
#define PERSPECTIVE

// 只负责进行一次投影，不负责其他部分。

#include "../camera/camera.hpp"
#include "../device/device.hpp"

#include<vector>
#include <DirectXMath.h>
#include <string>
#include <vector>

// 明确使用DirectX命名空间
using namespace std;
using namespace DirectX;

namespace SoftEngine{
    class Calculater{
        public:
        static vector<DirectX::XMFLOAT2> linearInterpolation(vector<DirectX::XMFLOAT3> allDot, int distance);
        static void CoordinateConversion(vector<DirectX::XMFLOAT2>& alldot, int width, int height);
        static void CoordinateConversionDepth(vector<DirectX::XMFLOAT3>& alldot, int width, int height);
        static DirectX::XMFLOAT2 dotLinearInterpolation(DirectX::XMFLOAT3 dot, int distance);
        static void linearInterpolationDepth(vector<XMFLOAT3>& allDot,int distance);
        static void dotLinearInterpolationDepth(XMFLOAT3& dot,int distance);
    };
    
    class DotPerspective{
        public:
            Camera usingCamera;

            // 新建一个处理点投影的类，需要传入一个相机
            DotPerspective(Camera camera);

            // 根据摄像机的信息，将一个三维点投影到二维平面上。
            vector<XMFLOAT2> projectRectangle(vector<DirectX::XMFLOAT3> allDot);
    };

    class MeshPerspective{
        public :
        Camera usingCamera;
        MeshPerspective(Camera usingCamera):usingCamera(usingCamera){};
        vector<vector<DotColorful>> projectModel(Model model);
    };
}

#endif